package com.chen.web;

import com.chen.domain.*;
import com.chen.domain.User;
import com.chen.service.HelloService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @decription
 * @atuhor:陈红卫
 * @create : 2017-06-18-20:10
 */
@RestController
public class RefactorHelloController  implements HelloService{
    @Override
    public String hello(@RequestParam("name") String name) {
        return "hello "+name;
    }

    @Override
    public User hello(@RequestHeader("name") String name, @RequestHeader("age") Integer age) {
        return new User(Long.valueOf(1),"zhousb",12,"江西上饶");
    }

    @Override
    public String hello(@RequestBody User user) {
        return "hello "+ user.getName()+","+user.getName();
    }
}
